package main.java.com.lee.pool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.IntStream;

/**
 * @Description TODO
 * @Author winston
 * @DateTime 2021/12/8
 */
public class ThreadPoolWithDiyThreadFactory {
	public static void main(String[] args) {

		threadFactoryTest();
	}

	private static void threadFactoryTest() {
		ExecutorService executorService = Executors.newFixedThreadPool(10, new MyThreadFactory());
		IntStream.rangeClosed(1, 10).forEach(i->{
			executorService.submit(() -> {System.out.println(Thread.currentThread().getName()+"__:    "+i);});
		});
		executorService.shutdown();
	}
}
